import api from './index'

interface Assignment {
  examId: number
  examName: string
  examTime: string
  teachers: number[]
  teacherNames: string[]
}

interface ScheduleStats {
  maxAssignments: number
  minAssignments: number
  assignmentDifference: number
  totalTrips: number
  objectiveValue: number
}

interface ScheduleResult {
  assignments: Assignment[]
  stats: ScheduleStats
  message: string
}

export const scheduleApi = {
  scheduleExams: (): Promise<ScheduleResult> => {
    return api.post('/schedule')
  },

  getAssignments: (): Promise<any[]> => {
    return api.get('/assignments')
  }
}
